package com.loves.admin.vo;

import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

public class LoginVO {
    private String mailName;

    private String password;

    private Collection<GrantedAuthority> authorities;

    public String getMailName() {
        return mailName;
    }

    public void setMailName(String mailName) {
        this.mailName = mailName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Collection<GrantedAuthority> getAuthorities() {
        return authorities;
    }

    public void setAuthorities(Collection<GrantedAuthority> authorities) {
        this.authorities = authorities;
    }


    public static final class Builder {
        private String mailName;
        private String password;
        private Collection<GrantedAuthority> authorities;

        public Builder mailName(String mailName) {
            this.mailName = mailName;
            return this;
        }

        public Builder password(String password) {
            this.password = password;
            return this;
        }

        public Builder authorities(Collection<GrantedAuthority> authorities) {
            this.authorities = authorities;
            return this;
        }

        public LoginVO build() {
            LoginVO loginVO = new LoginVO();
            loginVO.setMailName(mailName);
            loginVO.setPassword(password);
            loginVO.setAuthorities(authorities);
            return loginVO;
        }
    }
}
